var box = $("#change")
var pageNo = 2
var formId = 379
box.click(function () {
    console.log(33);
    var script = document.createElement("script")
    script.src = "https://api.gogoup.com/p1/data/recommend?type=0&pageNo=" + pageNo + "&pageSize=5&fromId=" + formId + "&jsonpcallback=callback&_=" + Date.now();
    document.body.append(script)
})
function callback(data) {
    console.log(data);
    var html = ""
    for (var i = 0; i < data.datas.length; i++) {
        html += `<li>
        <img src="${data.datas[i].image}" alt="">
        <span>${data.datas[i].name}</span>
        </li>  `
    }
    $(".yi").html(html)
    pageNo++
    formId = data.datas[data.datas.length - 1].courseId
    console.log(formId);
}
